package com.jinzhi.jzweb.controller;

import com.jinzhi.common.utils.ApiResult;
import com.jinzhi.common.utils.StringUtil;
import com.jinzhi.jzweb.service.JzTrainCertificateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author mengzhichao
 * @create 2022-09-23-16:24
 */
@Slf4j
@RestController
@RequestMapping("/jzApi/ApiTrainCertificateController")
public class ApiTrainCertificateController {

    @Autowired
    private JzTrainCertificateService jzTrainCertificateService;

    /**
     * 岗位合格证书查询
     * @param certificateNumber
     * @param idNumber
     * @param name
     * @return
     */
    @GetMapping("/getUserCertificate")
    public ApiResult getUserCertificate(String certificateNumber, String idNumber, String name){
         if(StringUtil.isNull(certificateNumber) && StringUtil.isNull(idNumber) && StringUtil.isNull(name)){
             ApiResult.fail("至少输入一项进行查询");
         }
         return ApiResult.success(jzTrainCertificateService.getUserCertificate(certificateNumber,idNumber,name));
    }


}
